package com.pearadmin.pro.modules.school.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;

import com.pearadmin.pro.modules.school.domain.CourseOutline;
import com.pearadmin.pro.modules.school.domain.CourseShiftInformation;
import com.pearadmin.pro.modules.school.param.CourseOutlineRequest;
import com.pearadmin.pro.modules.school.repository.CourseOutlineRepository;
import com.pearadmin.pro.modules.school.service.CourseOutlineService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

/**
 * 课程大纲Service业务层处理
 *
 * @author ChenJian
 * @date 2021-08-29
 */
@Service
public class CourseOutlineServiceImpl extends ServiceImpl<CourseOutlineRepository, CourseOutline> implements CourseOutlineService
{
    @Resource
    private CourseOutlineRepository courseOutlineRepository;

    /**
     * 查询课程大纲
     * @param request
     * @return 课程大纲 分页集合
     * */
    @Override
    public PageResponse<CourseOutline> page(CourseOutlineRequest request)
    {
        LambdaQueryWrapper<CourseOutline> query = new LambdaQueryWrapper<CourseOutline>();
        return Pageable.of(request,(()->  courseOutlineRepository.selectList(query)));
    }

    /**
     * 查询课程大纲
     *
     * @param id 课程大纲ID
     * @return 课程大纲
     */
    @Override
    public CourseOutline selectCourseOutlineById(Long id)
    {
        return courseOutlineRepository.selectById(id);
    }

}
